<template>
  <view class="card-elegant">
    <view class="card-header">
      <view class="name">{{ cardInfo.name }}</view>
      <view class="title">{{ cardInfo.title }}</view>
      <view class="company">{{ cardInfo.company }}</view>
    </view>
    <view class="avatar-container">
      <image :src="cardInfo.avatar" class="avatar" mode="widthFix"></image>
    </view>
    <view class="card-body">
      <view class="contact-item">
        <text class="content">{{ cardInfo.phone }}</text>
      </view>
      <view class="contact-item">
        <text class="content">{{ cardInfo.email }}</text>
      </view>
      <view class="contact-item">
        <text class="content">{{ cardInfo.address }}</text>
      </view>
    </view>
    <view class="card-footer">
      <image :src="cardInfo.qrcode" class="qrcode" mode="widthFix"></image>
    </view>
  </view>
</template>

<script setup>
// import { defineProps } from 'vue'

const props = defineProps({
		cardInfo: {
			type: Object,
			default: () => ({
				name: '张三-elegant',
				title: '总经理',
				company: '深圳市惠森信息科技有限公司',
				phone: '15013869352',
				email: 'asdf@test.com',
				address: '同乐村',
				avatar: 'https://picsum.photos/id/1005/200/200',
				qrcode: 'https://picsum.photos/id/237/100/100'
			})
		}
	})
</script>

<style scoped>
.card-elegant {
  width: 560rpx;
  border-radius: 24rpx;
  box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background-color: white;
  position: relative;
  padding: 40rpx 30rpx 20rpx;
}

.card-header {
  text-align: center;
  padding-bottom: 20rpx;
  border-bottom: 1px solid #eee;
}

.name {
  font-size: 44rpx;
  font-weight: 500;
  color: #222;
  letter-spacing: 2rpx;
}

.title {
  font-size: 28rpx;
  color: #666;
  margin-top: 10rpx;
  font-style: italic;
}

.company {
  font-size: 26rpx;
  color: #999;
  margin-top: 5rpx;
  letter-spacing: 1rpx;
}

.avatar-container {
  width: 140rpx;
  height: 140rpx;
  border-radius: 50%;
  overflow: hidden;
  border: 6rpx solid white;
  margin: -70rpx auto 20rpx;
  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
  background-color: #f8f8f8;
}

.avatar {
  width: 100%;
  height: 100%;
}

.card-body {
  padding: 20rpx 0;
}

.contact-item {
  display: flex;
  justify-content: center;
  padding: 12rpx 0;
}

.content {
  font-size: 28rpx;
  color: #444;
  letter-spacing: 1rpx;
}

.card-footer {
  display: flex;
  justify-content: center;
  padding: 20rpx 0 10rpx;
}

.qrcode {
  width: 100rpx;
  height: 100rpx;
  border-radius: 10rpx;
}
</style>
